<template lang="html">
  <el-button type="text" @click="doDownload">{{ fileName }}</el-button>
</template>

<script>
export default {
  name: "button-text-file",
  components: {},
  mixins: [],
  props: {
    url: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  computed: {
    fileName() {
      return this.$getFileName(this.url);
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    /**
     * 下载
     */
    doDownload() {
      location.href = this.url;
    },
  },
};
</script>

<style lang="scss" scoped></style>
